cc.Class({
    extends: cc.Component,

    properties: {
        // foo: {
        //    default: null,
        //    url: cc.Texture2D,  // optional, default is typeof default
        //    serializable: true, // optional, default is true
        //    visible: true,      // optional, default is true
        //    displayName: 'Foo', // optional
        //    readonly: false,    // optional, default is false
        // },
        // ...
        typeIcon :{
            default: null,
            type : cc.Node,
        },
        iconName :{
            default: null,
            type : cc.Node,
        },
        gold :{
            default: null,
            type : cc.Node,
        },
        iconList :{
            default: [],
            type : cc.SpriteFrame,
        },
    },

    // use this for initialization
    onLoad: function () {

    },

    init:function(item){
        var name = item.name;
        var index = item.photoIdx;
        var gold = item.gold;

        this.iconName.getComponent(cc.Label).string = new String(name);
        this.typeIcon.getComponent(cc.Sprite).spriteFrame = this.iconList[index];
        this.gold.getComponent(cc.Label).string = new String(gold);
    }

    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});
